<template>
	<view>
		<view class="" style="padding-bottom: 180rpx;">
			<u-swiper :list="dataAll.images_text" circular  height="300" radius="0"></u-swiper>
			<view class="block mainpadding ffffff">
				<view class="zhonghei sanshier fonweight ">{{dataAll.name}}</view>
				
				<view class="flexleft margin_top2">
					<view class="fenbox margin_right1">积分抵扣￥{{dataAll.score_price}}</view>
					<view class="huangbox margin_right1" v-show="Number(dataAll.sdyh_price)">首单优惠￥{{dataAll.sdyh_price}}</view>
					<view class="fenbox" v-show="Number(dataAll.activity_price)">活动优惠￥{{dataAll.activity_price}}</view>
				</view>
				<view class="flexbetween flex_wrap ">
					<view class="wushi margin_top" v-for="(value,key,index) in dataAll.attr_text" :key="key">
						<view class="flexleft">
							<view class="ershib xiaohui margin_right1">{{value}}</view>
							<view class="ershib zhonghei ">{{key}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="ffffff mainpadding ">
				<u-parse :content="dataAll.content"></u-parse>
			</view>
		</view>
		<view class="gudingdb ffffff mainpadding flexbetween">
			<view class="xiaocheng strongtext">￥
				<text class="bigtext fonweight xiaocheng">{{dataAll.salesprice}}</text>
			</view>
			<view class="huabtn flexcenter" @click="goYuDing(listid)">立即预定</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				start:"",
				end:"",
				startime: "", //开始时间
				endtime: "", //结束时间
				startweek: "", //开始周
				endweek: "", //结束周
				daynum: 1,
				listid:"",
				dataAll:{},
				
				show:false,
			}
		},
		onLoad(options) {
			let data = JSON.parse(decodeURIComponent(options.msg));
			this.listid = data.id
			this.start = data.start
			this.end = data.end
			this.startime = data.startime
			this.endtime = data.endtime
			this.startweek = data.startweek
			this.endweek = data.endweek
			this.daynum = data.daynum
			this.init()
		},
		methods: {
			init() {
				httpRequest.request('/api/hotelcl/hotelTypeDetail', 'GET', {
					id: this.listid
				}, false, false, false).then(res => {
					this.show=true
					this.dataAll = res.data
				}).catch(err => {
					this.show=true
					httpRequest.toast(err.msg);
				})
			},
			goYuDing(id){
				let date = {
					id,
					start:this.start,
					end:this.end,
					startime: this.startime, //开始时间
					endtime: this.endtime, //结束时间
					startweek: this.startweek, //开始周
					endweek: this.endweek, //结束周
					daynum: this.daynum,
				}
				if (!httpRequest.checkIsLogin()) {
				 httpRequest.doLogin();
				 return false;
				}else{
				 uni.navigateTo({
					url: '/pages_lianmengsc/yuding?msg=' + encodeURIComponent(JSON.stringify(date))
				 })
				} 
			},
		}
	}
</script>

<style lang="scss" scoped>
	.huabtn {
		width: 295rpx;
		height: 76rpx;
		border-radius: 120rpx;
		font-size: 32rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
		background-color: #FF9341;
	}

	.huangbox {
		background-color: #fff5ec;
		padding: 4rpx 7rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 22rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #FF9341;
	}

	.fenbox {
		background-color: #fff0ef;
		padding: 4rpx 7rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 22rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #FB605C;
	}

	.block {
		position: relative;
		top: -30rpx;
		border-radius: 39rpx 39rpx 0rpx 0rpx;
	}
</style>